<include file="../Public/header.html" />
<link href="__PUBLIC__/Css/user.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Css/orderDetail.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="__PUBLIC__/Js/user/common.js" charset="UTF-8"></script>
<script type="text/javascript">
    //鼠标移动表格效果
    $(document).ready(function(){
    	var stype="<php>echo empty($_REQUEST['stype'])?'all':$_REQUEST['stype'];</php>";
    	k_changeGroupStyle('right_box',' #top_nav > ul > li',stype,'top_baron');
    	inittable();
    	<php>if(!empty($_REQUEST['order_id'])){</php>
    	$('.gift_list > #order_list').find('tr').each(function(){
    		if($(this).attr('rel')!='order_{$_REQUEST['order_id']}'&&$(this).attr('rel')!='order_title')$(this).hide();
    	});
    	$('#show_order_page').hide();
    	//$('#show_order_list').show();
    	$('#ajx_show_area').show();
    	<php>}</php>
    	<php>if(!empty($_REQUEST['paytype'])){</php>
			doPay();
		<php>}</php>
		
    });
    
    function inittable(){
        $(".list").find('tr').hover(
          function () {
            $(this).addClass("bg_hover");
          },
          function () {
            $(this).removeClass("bg_hover");
          }
        );
    }
    function goPage(pno){
    	showOrderList();
 		$.kajax({      
			url:"{:U('User://Index/ajxSendList')}",      
			type:'post', //数据发送方式  
			data:{pno:pno,stype:$('#ajx_show_area_gift_list').find('#stype').val()} ,    
			async: false ,//同步方式     
			success: function(html){ 
				$('#ajx_show_area_gift_list').html(html);
			}
		});
 	}
    
    function showOrderDetail(oid){
    	
    	$('.list > #order_list').find('tr').each(function(){
    		if($(this).attr('rel')!='order_'+oid&&$(this).attr('rel')!='order_title')$(this).hide();
    	});
    	$('#show_order_page').hide();
    	//$('#show_order_list').show();
    	$('#ajx_show_area').show();
    	$('#ajx_show_area_detail').html($('#show_loading_html').html());
    	$.kajax({      
    		url:"{:U('Product://Order/ajxDetail')}",      
    		type:'post', //数据发送方式  
    		data:{order_id:oid} ,    
    		async: false ,//同步方式     
    		success: function(html){ 
    			$('#ajx_show_area_detail').html(html);
    		}
    	});
    }
    function showOrderList(oid){
    	$('.list > #order_list').find('tr').each(function(){
    		$(this).show();
    	});
    	//$('#show_order_list').hide();
    	$('#show_order_page').show();
    	$('#ajx_show_area').hide();
    }
    
    function ajxGetSendList(stype){
    	k_changeGroupStyle('right_box',' #top_nav > ul > li',stype,'top_baron');
    	$('#ajx_show_area_gift_list').find('#stype').val(stype);
    	goPage(1);
    }
    
    function ajxDeleteOrder(oid){
    	$.kajax({      
    		ajx_rtn_type:'JSON',
    		url:"{:U('User://Index/ajxDeleteOrder')}",      
    		type:'post', //数据发送方式  
    		data:{order_id:oid} ,    
    		async: false ,//同步方式     
    		success: function(jsonobj){ 
    			if(jsonobj.status==1){
    				k_success(jsonobj.msg);
    				goPage(1);
    			}else{
    				k_error(jsonobj.msg);
    			}
    		}
    	});
    }
</script>

<div id="mainWrapper">

	<div id="main">

		<include file="../User/Tpl/default/Public/user_left_nav_box.html" />
  
  		<div id="right_box">
  			<div class="item_top" id="top_nav">
  				<span style="float:right;font-weight:bold">
					共：&nbsp;
					<font style="color:red;font-size:16px;font-style: italic;" id="total_no">0</font>
					&nbsp;件&nbsp;&nbsp;
				</span>
				<ul>
					<li class="top_bar top-bar-wide top_baron" rel='all' onclick="ajxGetSendList('all');">{$userNavDict[MODULE_NAME][ACTION_NAME]}</li>
				</ul>
				<ul>
					<li class="top_bar top-bar-wide" rel='pay' onclick="ajxGetSendList('pay');">已付款的</li>
				</ul>
				<ul>
					<li class="top_bar top-bar-wide" rel='unpay' onclick="ajxGetSendList('unpay');">未付款的</li>
				</ul>
			</div>
  			<div id="ajx_show_area_gift_list">
			  	<include file="../User/Tpl/default/Index/send_list_box.html" />
			  </div>
			  <div id="clear"></div>
			  
			  <div id="ajx_show_area" style="margin-top:20px;display: none;">
			  	<div class="item_top">
			   		<span style="float:right;padding-top: 7px;cursor: pointer;" onclick="showOrderList()">显示列表&nbsp;</span>
					<ul>
						<li class="top_bar top-bar-wide top_baron">订单详情</li>
					</ul>
				</div>
				<div id="ajx_show_area_detail">     
				<php>$order_id=$_REQUEST['order_id'];$paytype=$_REQUEST['paytype'];
				</php> 	
			  		<include file="../Product/Tpl/default/Order/detail_box.html" />
				</div>
		      </div>
			<div id="clear"></div>
		
	</div>
</div>

<include file="../Public/footer.html" />